<extend name="Public/layout" />
<style>
    .pagination {
        font-size: 0;
    }

    .pagination .page-item,
    .pagination .prev,
    .pagination .next,
    .pagination .dotted {
        display: inline-block;
        height: 32px;
        line-height: 32px;
        text-align: center;
        font-size: 14px;
    }

    .pagination .page-item,
    .pagination .prev,
    .pagination .next {
        border: 1px solid #ddd;
        color: #ddd;
        margin-left: 8px;
        vertical-align: top;
    }

    .pagination a.page-item,
    .pagination a.prev,
    .pagination a.next {
        color: #666666;
    }

    .pagination a.page-item:hover,
    .pagination a.prev:hover,
    .pagination a.next:hover {
        border-color: #ff7e00;
        color: #ff7e00;
        text-decoration: none;
    }

    .pagination .page-item {
        min-width: 24px;
        _width: 24px;
        padding: 0 4px;
        font-family: tahoma;
    }

    .pagination .prev,
    .pagination .next {
        width: 73px;
    }

    .pagination .prev {
        margin-left: 0;
    }

    .pagination .prev b {
        padding-right: 6px;
    }

    .pagination .next b {
        padding-left: 6px;
    }

    .pagination .dotted {
        margin: 0 5px 0 16px;
        color: #8C8C8C;
    }

    .pagination .current {
        background: #ff7e00;
        border-color: #ff7e00;
        color: #fff !important;
    }

    .num {
        padding: 10px;
        background: #00a157;
        border: 1px solid #00acd6;
    }
</style>
<block name="body">
    <div class="row">
        <div class="col-xs-12">
            <style type="text/css">
                .ah td {
                    padding: 20px 5px;
                }

                .cp_th {
                    /* background-color: #34ccce; */
                    padding: 10px;
                }

                .ui-flex,
                .ui-flex-center,
                .ui-flex-between,
                .ui-flex-around,
                .ui-flex-column {
                    position: relative;
                    display: -webkit-box;
                    display: -webkit-flex;
                    display: -ms-flexbox;
                    display: flex;
                    -webkit-box-align: center;
                    -webkit-align-items: center;
                    -ms-flex-align: center;
                    align-items: center;
                    color: inherit;
                }

                .ui-flex-lt {
                    -webkit-align-self: flex-start;
                    -moz-align-self: flex-start;
                    align-self: flex-start;
                }

                .ui-flex-1 {
                    -webkit-flex: 1;
                    flex: 1;
                }

                /* 文字截断 */
                .ui-nowrap,
                .ui-nowrap-flex,
                .ui-nowrap-2,
                .ui-nowrap-3 {
                    overflow: hidden;
                    text-overflow: ellipsis;
                }

                .ui-nowrap {
                    max-width: 100%;
                    white-space: nowrap;
                }

                .ui-nowrap-flex,
                .ui-nowrap-2,
                .ui-nowrap-3 {
                    display: -webkit-box;
                    /*! autoprefixer: off */
                    -webkit-box-orient: vertical;
                    /*! autoprefixer: on */
                }

                .ui-nowrap-flex {
                    -webkit-line-clamp: 1;
                    -webkit-box-flex: 1;
                    height: inherit;
                }

                /*要截断的行数*/
                .ui-nowrap-2 {
                    -webkit-line-clamp: 2;
                }

                .data-show-container {
                    background-color: #ecf0f5;
                    padding-bottom: 15px;
                }

                .data-show-wrap {
                    /* margin: 50px 0; */
                }

                .data-show-wrap .data-show-item {
                    flex: 1;
                    text-align: center;
                    font-size: 12px;
                    color: #666;
                    background-color: #fff;
                    margin: 10px;
                    border-radius: 5px;
                    padding: 20px 0;
                }

                .data-show-wrap .data-show-item .data-show-num {
                    font-size: 35px;
                    color: #333;
                }

                .sub-title {
                    background-color: #ecf0f5;
                    color: #333;
                    font-size: 20px;
                    padding-bottom: 15px;
                }

                table {
                    color: #666;
                }
            </style>
            <div class="box flat box-primary" style="border:none;">
                <div class="data-show-container">
                    <div class="ui-flex data-show-wrap">
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['today_input_count']||default="0"}</div>
                            <div class="data-show-title">今日录单</div>
                        </div>
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['today_order_count']||default="0"}</div>
                            <div class="data-show-title">今日订单</div>
                        </div>
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['today_money']||default="0"}</div>
                            <div class="data-show-title">今日金额</div>
                        </div>
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['today_yugu']||default="0"}</div>
                            <div class="data-show-title">今日预估</div>
                        </div>
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['yestoday_order_count']||default="0"}</div>
                            <div class="data-show-title">昨天订单</div>
                        </div>
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['yestoday_yugu']||default="0"}</div>
                            <div class="data-show-title">上月预估</div>
                        </div>
                    </div>
                    <div class="ui-flex data-show-wrap">
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['thismon_input']||default="0"}</div>
                            <div class="data-show-title">本月录单</div>
                        </div>
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['thismon_order']||default="0"}</div>
                            <div class="data-show-title">本月订单</div>
                        </div>
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['thismon_yugu']||default="0"}</div>
                            <div class="data-show-title">本月预估</div>
                        </div>
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['lastmon_input']||default="0"}</div>
                            <div class="data-show-title">上月录单</div>
                        </div>
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['lastmon_order']||default="0"}</div>
                            <div class="data-show-title">上月订单</div>
                        </div>
                        <div class="data-show-item">
                            <div class="data-show-num">{$alldata['lastmon_yugu']||default="0"}</div>
                            <div class="data-show-title">上月预估</div>
                        </div>
                    </div>
                </div>
                <div class="data-show-container-margin"></div>
                <div class="sub-title">店铺统计</div>
                <div class="box-body aaaaaa" id="{$boxId}">
                    <div class="table-wrap">
                        <table id="{$tableId}" class="table table-bordered table-hover table-condensed table-nowrap"
                            data-table-name="{$tableId}" style="display:none">
                            <thead>
                                <tr>
                                    <th style="text-align: center;vertical-align: middle;"
                                        style="background: linear-gradient(45deg, #f43f3b, #ec008c);">今日录单</th>
                                    <th style="text-align: center"
                                        style="background: linear-gradient(45deg, #0081ff, #1cbbb4);">今日订单</th>
                                    <th style="text-align: center"
                                        style="background: linear-gradient(45deg, #f43f3b, #ec008c);">今日金额</th>
                                    <th style="text-align: center"
                                        style="background: linear-gradient(45deg, #0081ff, #1cbbb4);">今日预估</th>
                                    <th style="text-align: center"
                                        style="background: linear-gradient(45deg, #f43f3b, #ec008c);">昨天订单</th>
                                    <th style="text-align: center"
                                        style="background: linear-gradient(45deg, #0081ff, #1cbbb4);;">昨天预估</th>
                                </tr>
                            </thead>
                            <tbody class="ah">
                                <tr>
                                    <td style="text-align: center">{$alldata['today_input_count']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['today_order_count']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['today_money']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['today_yugu']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['yestoday_order_count']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['yestoday_yugu']||default="0"}</td>
                                </tr>
                            </tbody>
                        </table>
                        <table style="display:none" id="{$tableId}2"
                            class="table table-bordered table-hover table-condensed table-nowrap"
                            style="margin-top: 30px;" data-table-name="{$tableId}2">
                            <thead>
                                <tr>
                                    <th style="text-align: center;vertical-align: middle;"
                                        style="background: linear-gradient(45deg, #f43f3b, #ec008c);">本月录单</th>
                                    <th style="text-align: center"
                                        style="background: linear-gradient(45deg, #0081ff, #1cbbb4);">本月订单</th>
                                    <th style="text-align: center"
                                        style="background: linear-gradient(45deg, #f43f3b, #ec008c);">本月预估</th>
                                    <th style="text-align: center"
                                        style="background: linear-gradient(45deg, #0081ff, #1cbbb4);">上月录单</th>
                                    <th style="text-align: center"
                                        style="background: linear-gradient(45deg, #f43f3b, #ec008c);">上月订单</th>
                                    <th style="text-align: center"
                                        style="background: linear-gradient(45deg, #0081ff, #1cbbb4);">上月预估</th>
                                </tr>
                            </thead>
                            <tbody class="ah">
                                <tr>
                                    <td style="text-align: center">{$alldata['thismon_input']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['thismon_order']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['thismon_yugu']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['lastmon_input']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['lastmon_order']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['lastmon_yugu']||default="0"}</td>
                                </tr>
                            </tbody>
                        </table>
                        <div class="dataTables_tool clearfix" style="margin-top: 10px;">
                            <form>
                                <div class="input-group date" style="width: 204px; float: left;">
                                    <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                    <input type="hidden" name="d_start_time" class="text date"
                                        value="$start_time" />
                                    <input style="width: auto;" type="text" data-name="d_start_time"
                                        class="form-control date datepicker" value="{$start_time}"
                                        placeholder="请选择开始日期" data-type="date" />
                                </div>
                                <div class="input-group date" style="width: 204px; float: left;margin-left: 10px;">
                                    <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                    <input type="hidden" name="d_end_time" class="text date"
                                        value="{$end_time}" />
                                    <input style="width: auto;" type="text" data-name="d_end_time"
                                        class="form-control date datepicker" value="{$end_time}"
                                        placeholder="请选择结束日期" data-type="date" />
                                </div>
                                <div class="input-group date" style="width: 204px; float: left;margin-left: 10px;">
                                    <input type="text" name="seller_title" class="form-control"
                                        value="{:I('get.seller_title')}" placeholder="输入店铺名称" />
                                </div>
                                <button style="line-height: 20px;margin-top:auto;margin-left: 10px;" type="submit"
                                    class="btn btn-flat _dt_btns_ btn-default" data-callback="form" data-param=""> 搜索
                                </button>
                            </form>
                        </div>
                        <table id="{$tableId}5" class="table table-bordered table-hover table-condensed table-nowrap"
                            style="margin-top: 10px;" data-table-name="{$tableId}5">
                            <thead>
                                <!-- <tr>
                                    <th colspan="8" class="cp_th">店铺统计</th>
                                </tr> -->
                                <tr>
                                    <th style="text-align: center;vertical-align: middle;">店铺名称</th>
                                    <th style="text-align: center">活动ID</th>
                                    <th style="text-align: center">开始时间</th>
                                    <th style="text-align: center">结束时间</th>
                                    <th style="text-align: center">结束/天数</th>
                                    <th style="text-align: center">订单数量</th>
                                    <th style="text-align: center">成交金额</th>
                                    <th style="text-align: center">预估收益</th>
                                </tr>
                            </thead>
                            <tbody>
                                <foreach name="gongsibang" item="row4">
                                    <tr>
                                        <td style="text-align: left">{$row4['seller_title']}</td>
                                        <td style="text-align: center">{$row4['taobao_act_id']}</td>
                                        <td style="text-align: center">{$row4['start_time']}</td>
                                        <td style="text-align: center">{$row4['end_time']}</td>
                                        <td style="text-align: center">{$row4['days']}</td>
                                        <td style="text-align: center">{$row4['todayordercount']||default="0.00"}</td>
                                        <td style="text-align: center">{$row4['ordermoney']||default="0.00"}</td>
                                        <td style="text-align: center">{$row4['yugu_money']||default="0.00"}</td>
                                    </tr>
                                </foreach>
                            </tbody>
                        </table>
                        <br>
                        <br>
                        <div class="dataTables_tool clearfix" style="margin-top: 10px;">
                            <form>
                                <div class="input-group date" style="width: 204px; float: left;">
                                    <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                    <input type="hidden" name="start_time" class="text date"
                                        value="{$start_time}" />
                                    <input style="width: auto;" type="text" data-name="start_time"
                                        class="form-control date datepicker" value="{$start_time}"
                                        placeholder="请选择开始日期" data-type="date" />
                                </div>
                                <div class="input-group date" style="width: 204px; float: left;margin-left: 10px;">
                                    <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                    <input type="hidden" name="end_time" class="text date"
                                        value="{$end_time}" />
                                    <input style="width: auto;" type="text" data-name="end_time"
                                        class="form-control date datepicker" value="{$end_time}"
                                        placeholder="请选择结束日期" data-type="date" />
                                </div>
                                <div class="input-group date" style="width: 204px; float: left;margin-left: 10px;">
                                    <select name="validCode" class="form-control">
                                        <option <php>if($validCode == 1)echo "selected"</php> value="1">全部</option>
                                        <option <php>if($validCode == 15)echo "selected"</php> value="15">待付款</option>
                                        <option <php>if($validCode == 16)echo "selected"</php> value="16">已付款</option>
                                        <option <php>if($validCode == 17)echo "selected"</php> value="17">已完成</option>
                                        <option <php>if($validCode == 18)echo "selected"</php> value="18">已结算</option>
                                        <option <php>if($validCode == 30)echo "selected"</php> value="30">无效</option>
                                    </select>
                                </div>
                                <div class="input-group date" style="width: 204px; float: left;margin-left: 10px;">
                                    <select name="sellerCode" class="form-control">
                                        <option <php>if(!$sellerCode)echo "selected"</php> value="">全部</option>
                                        <foreach name="gongsibang" item="row4">
                                            <option <php>if($sellerCode == $row4['shopId'])echo "selected"</php>
                                                value="{$row4['shopId']}">{$row4['seller_title']}</option>
                                        </foreach>
                                    </select>
                                </div>
                                <div class="input-group date" style="width: 204px; float: left;margin-left: 10px;">
                                    <input type="text" name="ordersn" class="form-control" value="{:I('get.ordersn')}"
                                        placeholder="输入订单号" />
                                </div>
                                <button style="line-height: 20px;margin-top:auto;margin-left: 10px;" type="submit"
                                    class="btn btn-flat _dt_btns_ btn-default" data-callback="form" data-param=""> 搜索
                                </button>
                            </form>
                        </div>
                        <table id="{$tableId}4" class="table table-bordered table-hover table-condensed table-nowrap"
                            style="margin-top: 10px;" data-table-name="{$tableId}4">
                            <thead>
                                <tr>
                                    <th style="text-align: center;vertical-align: middle; width: 180px;">商品信息</th>
                                    <th style="text-align: center;vertical-align: middle;width: 140px;">订单号</th>
                                    <th style="text-align: center;width: 70px;">订单状态</th>
                                    <th style="text-align: center;width: 70px;">活动ID</th>
                                    <th style="text-align: center;width: 190px;">时间</th>
                                    <!--<th style="text-align: center">预估金额</th>-->
                                    <!--<th style="text-align: center">预估佣金</th>-->
                                    <th style="text-align: center;width: 70px;">预估</th>
                                    <th style="text-align: center;width: 70px;">团长费用</th>
                                    <th style="text-align: center;width: 70px;">分成比例</th>
                                    <th style="text-align: center;width: 70px;">实际金额</th>
                                    <th style="text-align: center;width: 70px;">实际佣金</th>
                                    <th style="text-align: center;width: 100px;">数量</th>
                                </tr>
                            </thead>
                            <tbody>
                                <if condition="$list">
                                    <foreach name="list" item="row2">
                                        <tr>
                                            <td style="text-align: left;vertical-align:middle;"><a href="{$row2['goods_url']}"
                                                    target="_blank">
                                                    <!--<div><img src="{$row2['logo_img']}" width="80px" />
                                                        <div
                                                            style="word-wrap: break-word;width: 180px;word-break:normal;white-space: nowrap;overflow:hidden;text-overflow:ellipsis">
                                                            {$row2['title']}</div>
                                                        <b>价格：{$row2['price']}</b>
                                                    </div>-->
                                                <div class="ui-flex">
                                                    <!--  <div><img src="{$row2['logo_img']}" width="80px" /><br />
                                                          <div
                                                                  style="word-wrap: break-word;width: 180px;word-break:normal;white-space: nowrap;overflow:hidden;text-overflow:ellipsis">
                                                              {$row2['title']}</div><b
                                                                  style="">价格：{$row2['price']}</b>
                                                      </div>-->
                                                    <div style="border:1px solid #ddd">
                                                        <img src="{$row2['logo_img']}" width="80px" />
                                                    </div>
                                                    <div class="ui-flex-lt" style="margin-left: 5px;">
                                                        <div class="ui-nowrap-2" style="white-space: normal"
                                                             title="{$row2['title']}"> {$row2['title']}</div>
                                                        <div>价格:{$row2['price']}</div>
                                                    </div>
                                                </div>
                                                </a></td>
                                            <td style="text-align: center;vertical-align:middle;">{$row2['order_no']}</td>
                                            <td style="text-align: center;vertical-align:middle;">{$row2['order_state_label']}</td>
                                            <td style="text-align: center;vertical-align:middle;">{$row2['taobao_act_id']}</td>
                                            <td style="text-align: left; width: 210px;vertical-align:middle;">
                                                <div>
                                                    下单时间：{$row2['order_time']}
                                                    <br />完成时间：{$row2['finish_time']}<br />
                                                    结算时间：{$row2['pay_month']}
                                                </div>
                                            </td>
                                            <td style="text-align: center;vertical-align:middle;">{$row2['estimateCosPrice']}</td>
                                            <td style="vertical-align:middle;text-align: center">{$row2['estimateFee']}</td>
                                            <td style="vertical-align:middle;text-align: center">{$row2['commissionRate']}</td>
                                            <!--<td style="text-align: center">{$row2['finalRate']}</td>-->
                                            <td style="vertical-align:middle;text-align: center">{$row2['actualCosPrice']}</td>
                                            <td style="vertical-align:middle;text-align: center">{$row2['actualFee']||default="0.00"}</td>
                                            <td style="vertical-align:middle;text-align: center">
                                                商品数量：{$row2['skuNum']}<br />售后数量：{$row2['frozenSkuNum']}<br />退货数量：{$row2['skuReturnNum']}
                                            </td>
                                        </tr>
                                    </foreach>
                                    <else />
                                    <tr>
                                        <td colspan="11"
                                            style="height: 200px; margin: 0px auto; text-align: center; vertical-align: middle; line-height: 200px;">
                                            暂无数据，或维护中.. </td>
                                    </tr>
                                </if>
                            </tbody>
                        </table>
                        <div style="text-align: center">{$page}</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        $(function () {
            $('.form-control.date.datepicker').change(function () {
                $(this).prev().val($(this).val());
            });

            $('.datepicker').each(function () {
                var $this = $(this);
                var dateType = $(this).attr('data-type');
                var handle = "datepicker";
                var format = "yyyy-mm-dd";
                var options = {
                    language: 'zh-CN',
                    autoclose: true,
                    templates: {
                        leftArrow: '<i class="fa fa-caret-square-o-left"></i>',
                        rightArrow: '<i class="fa fa-long-arrow-right"></i>'
                    },
                }
                switch (dateType) {
                    case 'timestamp':
                    case 'datetime':
                        format = "yyyy-mm-dd hh:ii";
                        handle = 'datetimepicker';
                        break;
                    case 'date':
                        format = "yyyy-mm-dd";
                        handle = 'datepicker';
                        break;
                }
                options.format = format;
                var fieldName = $this.attr('data-name');
                $this[handle](options)
                    .on('changeDate,change', function (e) {
                        var value = $(e.currentTarget).val();
                        $('input[name=' + fieldName + ']').val(value);
                    });
            });
        });
    </script>
</block>